using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Application.Dtos;

namespace ERP.WorkforceManage.Dtos
{
    /// <summary>
    /// 排班计划DTO
    /// </summary>
    public class SchedulingPlanDto : EntityDto<int>
    {
        /// <summary>
        /// 计划编号
        /// </summary>
        [Required]
        public string PlanNumber { get; set; }

        /// <summary>
        /// 计划名称
        /// </summary>
        [Required]
        public string PlanName { get; set; }

        /// <summary>
        /// 班组类型
        /// </summary>
        [Required]
        public string TeamType { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        [Required]
        public DateTime StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        [Required]
        public DateTime EndDate { get; set; }

        /// <summary>
        /// 轮班方式：白班、两班倒、三班倒
        /// </summary>
        public string ShiftSystem { get; set; }

        /// <summary>
        /// 工作制：按天、按周、按月、按季度
        /// </summary>
        public string WorkShiftSystem { get; set; }

        /// <summary>
        /// 倒班天数
        /// </summary>
        public int? DayCount { get; set; }

        /// <summary>
        /// 单据状态：0-草稿，1-已确认
        /// </summary>
        public int DocumentStatus { get; set; }
        
        /// <summary>
        /// 关联的班组ID列表
        /// </summary>
        public List<int> TeamIds { get; set; } = new List<int>();
    }

    /// <summary>
    /// 创建排班计划DTO
    /// </summary>
    public class CreateSchedulingPlanDto
    {
        /// <summary>
        /// 计划编号
        /// </summary>
        [Required]
        public string PlanNumber { get; set; }

        /// <summary>
        /// 计划名称
        /// </summary>
        [Required]
        public string PlanName { get; set; }

        /// <summary>
        /// 班组类型
        /// </summary>
        [Required]
        public string TeamType { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        [Required]
        public DateTime StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        [Required]
        public DateTime EndDate { get; set; }

        /// <summary>
        /// 轮班方式：白班、两班倒、三班倒
        /// </summary>
        public string ShiftSystem { get; set; }

        /// <summary>
        /// 工作制：按天、按周、按月、按季度
        /// </summary>
        public string WorkShiftSystem { get; set; }

        /// <summary>
        /// 倒班天数
        /// </summary>
        public int? DayCount { get; set; }

        /// <summary>
        /// 单据状态：0-草稿，1-已确认
        /// </summary>
        public int DocumentStatus { get; set; }
        
        /// <summary>
        /// 关联的班组ID列表
        /// </summary>
        public List<int> TeamIds { get; set; } = new List<int>();
    }

    /// <summary>
    /// 排班计划查询输入DTO
    /// </summary>
    public class SchedulingPlanGetListInputDto : PagedAndSortedResultRequestDto
    {
        /// <summary>
        /// 计划编号
        /// </summary>
        public string PlanNumber { get; set; }
        
        /// <summary>
        /// 计划名称
        /// </summary>
        public string PlanName { get; set; }
        
        /// <summary>
        /// 班组类型
        /// </summary>
        public string TeamType { get; set; }
        
        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }
        
        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }
    }

    public class UpdateSchedulingPlanDto
    {
        public string PlanNumber { get; set; }
        public string PlanName { get; set; }
        public string TeamType { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public string ShiftSystem { get; set; }
        public string WorkShiftSystem { get; set; }
        public int DocumentStatus { get; set; }
    }
    public class SchedulingPlanListDto
    {
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 10;
        public string? PlanNumber { get; set; }
        public string? PlanName { get; set; }
        public string? TeamType { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
    }
}
